package com.zebra.common.event;

import com.google.common.eventbus.AsyncEventBus;
import com.google.common.eventbus.EventBus;
import com.zebra.common.concurrent.ZebraThreadPool;

/**
 * @Description: 主要运用业务解耦
 *
 * @Date 2020/7/31 0031
 **/
public class EventBusCenter {
    //分异步， 和同步
    private static EventBus eventBus = new EventBus("Guava-Event");

    private EventBusCenter() {

    }

    public static EventBus getInstance() {
        return eventBus;
    }

    public static void register(Object obj) {
        eventBus.register(obj);
    }

    public static void unregister(Object obj) {
        eventBus.unregister(obj);
    }

    public static void post(Object obj) {
        eventBus.post(obj);
    }

}
